#include <iostream>
using namespace std;

signed main()
{
    int n,t;
    cin>>n>>t;
    int a,flag = 0,maxa=0;
    for(int i=0;i<n;i++){
        cin>>a;
        maxa = max(maxa,a);
        if(!flag&&a>t){
            flag = 1;
            cout<<"["<<i<<", ";
        }
        else if(a<=t){
            if(flag){
                cout<<i-1<<"]\n";
                flag = 0;
            }
        }
    }
    if(a>t)    cout<<n-1<<"]\n";
    if(maxa<=t)    cout<<maxa;
    return 0;
}
